﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateList.aspx.cs" Inherits="Medianamik.UI.ContentManagement.TemplateList"
MasterPageFile="../MasterPages/MedianamikModule.Master" %>
<%@ Import Namespace="Medianamik.Core" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
	<asp:HyperLink ID="AddTemplateLink" runat="server" NavigateUrl="/medianamik/modalwindows/websiteselectorwindow.aspx" class="Action BtAjouter"
        Text="<%$ Resources: Medianamik_ContentManagement, AddTemplate%>" />
	<asp:HyperLink runat="server" ID="ReturnLink" CssClass="Action BtAnnuler-Inactif" 
	Text="<%$ Resources: Medianamik_Global,Cancel %>" />
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">
    <asp:UpdatePanel ID="mainUpdatePanel" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <telerik:RadGrid runat="server" ID="templateGrid" EnableEmbeddedSkins="false" 
                Skin="Medianamik" AllowPaging="false" AutoGenerateColumns="false">
                <MasterTableView DataKeyNames="ID">
                    <Columns>
			            <telerik:GridTemplateColumn HeaderText="">
		                    <HeaderTemplate><asp:Literal ID="Literal1" runat="server" 
		                    Text="<%$ Resources: Medianamik_ContentManagement, TemplateNameColumn %>" /></HeaderTemplate>
		                    <ItemTemplate><img alt="" src="/Medianamik/images/Icones/Ico_Gabarit.png" 
		                    class="IconesElements" /><%# Eval("Name")%></ItemTemplate>
		                </telerik:GridTemplateColumn>
		                <telerik:GridBoundColumn HeaderText="<%$ Resources: Medianamik_ContentManagement, WebsiteColumn %>" DataField="WebSiteName" />
		            </Columns>
		            <NoRecordsTemplate>
			            <asp:Literal ID="NoRecords" runat="server" Text="<%$ Resources: Medianamik_ContentManagement, NoRecordsToDisplay %>" />
			        </NoRecordsTemplate>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

<asp:Content ID="ExternalContent" ContentPlaceHolderID="ExternalContentHolder" runat="server">
    <telerik:RadScriptBlock runat="server" ID="scriptBlock">
        <script type="text/javascript">
            //<![CDATA[
            function onWebSiteSelected(sender, eventArgs) {
                var argument = eventArgs.get_argument();
                
                if (argument && argument.WebSiteId) {
                    if (argument.WebSiteId) {
                        location.href = <%= "'" + ManagementURL + "?" + QueryStringParamNames.WebSiteId + "='" %> + argument.WebSiteId;
                    }
                }
            }
            //]]>
        </script>

    </telerik:RadScriptBlock>
</asp:Content>